From: Theodor Thornhill Date: Wed, 17 Jun 2020 23:05:31 +0000 (+0300) Subject: Add global bindings for project commands X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1^2~5^2~16^2~6381 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=2f231fcfb763626b8a4ede7da0f80da14a122ca9;p=emacs.git Add global bindings for project commands * lisp/progmodes/project.el (project-prefix-map): New variable. Add the new keymap to ctl-x-map. --- diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 1c1891fcf55..14aafdf2899 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -490,6 +490,23 @@ DIRS must contain directory names." ;; Sidestep the issue of expanded/abbreviated file names here. (cl-set-difference files dirs :test #'file-in-directory-p)) +;;;###autoload +(defvar project-prefix-map + (let ((map (make-sparse-keymap))) + (define-key map "f" 'project-find-file) + (define-key map "s" 'project-shell) + (define-key map "d" 'project-dired) + (define-key map "v" 'project-vc-dir) + (define-key map "c" 'project-compile) + (define-key map "e" 'project-eshell) + (define-key map "p" 'project-switch-project) + (define-key map "g" 'project-find-regexp) + (define-key map "r" 'project-query-replace-regexp) + map) + "Keymap for project commands.") + +;;;###autoload (define-key ctl-x-map "p" project-prefix-map) + (defun project--value-in-dir (var dir) (with-temp-buffer (setq default-directory dir)